//
//  AppDelegate.m
//  huaihe
//
//  Created by 暗流澎涌 on 2024/3/7.
//

#import "AppDelegate.h"
#import "huaiheManger.h"
#import "huaiheHomeVC.h"
#import "huaihecomingVC.h"
@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
   
    if ([huaiheManger obtainfirstComing]){
      
        huaiheHomeVC *vc = [[huaiheHomeVC alloc] init];
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
        self.window.rootViewController = nav;
        [self.window makeKeyAndVisible];
    }else{
        huaihecomingVC *vc = [[huaihecomingVC alloc] init];
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
        self.window.rootViewController = nav;
        [self.window makeKeyAndVisible];
        
        
    }
    [self bindinfo];
  
    
    return YES;
}

-(void)bindinfo{
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(huaiheGotoHome) name:@"huaiheComing" object:nil];

}

-(void)huaiheGotoHome{
    huaiheHomeVC *vc = [[huaiheHomeVC alloc] init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
    self.window.rootViewController = nav;
    [self.window makeKeyAndVisible];
}

-(UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window{
    
return UIInterfaceOrientationMaskPortrait;//默认全局不支持横屏

}

@end
